﻿using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace Brc_PaaS.Common.Model.Apollo
{
    public class CreateOrUpdateConfigInfoDto: SingleNamespaceConditionDto
    {
        /// <summary>
        /// 必填	
        /// 配置的key，长度不能超过128个字符。非properties格式，key固定为content
        /// </summary>
        [Required(ErrorMessage ="请输入配置得Key")]
        [MaxLength(60,ErrorMessage ="长度不能超过100")]
        [JsonProperty("key")]
        public string Key { get; set; }
        /// <summary>
        /// 必填
        /// 配置的value，长度不能超过20000个字符，非properties格式，value为文件全部内容
        /// </summary>
        [Required(ErrorMessage ="请输入配置的value")]
        [MaxLength(10000,ErrorMessage ="长度不能超过10000")]
        [JsonProperty("value")]
        public string Value { get; set; }
        /// <summary>
        /// 配置的备注, 长度不能超过1024个字符
        /// </summary>
        [MaxLength(512,ErrorMessage ="长度不能超过512")]
        [JsonProperty("comment")]
        public string Comment { get; set; }
        /// <summary>
        /// 新增时必填
        /// item的创建人，格式为域账号，也就是sso系统的User ID
        /// </summary>
        [JsonProperty("dataChangeCreatedBy")]
        public string DataChangeCreatedBy { get; set; }

        /// <summary>
        /// 修改时必填
        /// </summary>
        [JsonProperty("dataChangeLastModifiedBy")]
        public string DataChangeLastModifiedBy { get; set; }
    }
}
